package com.cookiesoft.order.service.impl;

import java.util.List;
        import com.cookiesoft.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cookiesoft.order.mapper.ZhenOrdersMapper;
import com.cookiesoft.order.domain.ZhenOrders;
import com.cookiesoft.order.service.IZhenOrdersService;

/**
 * 订单，存储用户订单信息Service业务层处理
 *
 * @author anc
 * @date 2024-11-06
 */
@Service
public class ZhenOrdersServiceImpl implements IZhenOrdersService {
    @Autowired
    private ZhenOrdersMapper zhenOrdersMapper;

    /**
     * 查询订单，存储用户订单信息
     *
     * @param orderId 订单，存储用户订单信息主键
     * @return 订单，存储用户订单信息
     */
    @Override
    public ZhenOrders selectZhenOrdersByOrderId(Long orderId) {
        return zhenOrdersMapper.selectZhenOrdersByOrderId(orderId);
    }

    /**
     * 查询订单，存储用户订单信息列表
     *
     * @param zhenOrders 订单，存储用户订单信息
     * @return 订单，存储用户订单信息
     */
    @Override
    public List<ZhenOrders> selectZhenOrdersList(ZhenOrders zhenOrders) {
        return zhenOrdersMapper.selectZhenOrdersList(zhenOrders);
    }

    /**
     * 新增订单，存储用户订单信息
     *
     * @param zhenOrders 订单，存储用户订单信息
     * @return 结果
     */
    @Override
    public int insertZhenOrders(ZhenOrders zhenOrders) {
                zhenOrders.setCreateTime(DateUtils.getNowDate());
            return zhenOrdersMapper.insertZhenOrders(zhenOrders);
    }

    /**
     * 修改订单，存储用户订单信息
     *
     * @param zhenOrders 订单，存储用户订单信息
     * @return 结果
     */
    @Override
    public int updateZhenOrders(ZhenOrders zhenOrders) {
        return zhenOrdersMapper.updateZhenOrders(zhenOrders);
    }

    /**
     * 批量删除订单，存储用户订单信息
     *
     * @param orderIds 需要删除的订单，存储用户订单信息主键
     * @return 结果
     */
    @Override
    public int deleteZhenOrdersByOrderIds(Long[] orderIds) {
        return zhenOrdersMapper.deleteZhenOrdersByOrderIds(orderIds);
    }

    /**
     * 删除订单，存储用户订单信息信息
     *
     * @param orderId 订单，存储用户订单信息主键
     * @return 结果
     */
    @Override
    public int deleteZhenOrdersByOrderId(Long orderId) {
        return zhenOrdersMapper.deleteZhenOrdersByOrderId(orderId);
    }
}
